## jenkins 安装
# 配置源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

# 必要工具安装
yum update -y && \
yum install -y net-tools telnet nload iftop wget lrzsz && \
yum install -y iotop && \
yum install -y vim

# docker 安装
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine && \
yum install -y yum-utils device-mapper-persistent-data lvm2 && \
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo && \
yum install -y docker-ce docker-ce-cli && \
yum install -y epel-release && \
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo && \
yum install -y docker-compose

#启动docker
systemctl daemon-reload
service docker restart

#region拉取镜像
docker login --username=100015047134  -p L6^mRlXhbpTn#_ ccr.ccs.tencentyun.com
docker pull ccr.ccs.tencentyun.com/octopus-service/jenkinsci-blueocean:latest
# 1.使用docker安装 jenkins
docker run \
  -u root \
  -d \
  -p 8080:8080 \
  -p 50000:50000 \
  -v $(which docker):/bin/docker \
  -v /var/jenkins_home:/var/jenkins_home \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --restart=always \
  --name=jenkinsci \
  ccr.ccs.tencentyun.com/octopus-service/jenkinsci-blueocean:latest
